package com.ymttest.database.mongo;

import java.util.Map;

import com.ymt.database.MongoDBDriver;

public class ProductActivityStockInfoWapper {
	MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_YmtProductDBdriver("ProductActivityStockInfo");
	
	@SuppressWarnings("unchecked")
	public Map<String, Object> getByProductId(String productId) throws Exception{
		  return  mdd.selectPartLimitToMap("{\"ProductId\":\"" + productId + "\"}",1).get(0);
	}
	
	public Map<String, Object> getByCatalogIdId(String CatalogId) throws Exception{
		  return  mdd.selectPartLimitToMap("{\"CatalogId\":\"" + CatalogId + "\"}",1).get(0);
	}
	
	public Map<String, Object> getByProductActivityId(int productInActivityId) throws Exception{
		  return  mdd.selectPartLimitToMap("{\"ProductActivityId\":" + productInActivityId + "}",1).get(0);
	}
	
	public static void main(String[] args) throws Exception {
		System.out.println(new ProductActivityStockInfoWapper().getByProductActivityId(297393).get(0).toString());
	}
}
